/**
 *******************************************************************************
 *  FileName  : init.h
 *  Date      : 2023-4-21
 *  Author    : GaoQiu
 *  Copyright : (C)All rights reserved.
 *******************************************************************************
 *
 * The information contained herein is confidential and proprietary property of
 * GaoQiu and is available under the terms of Commercial License Agreement
 * between GaoQiu and the licensee in separate contract or the terms described
 * here-in.
 *
 * This heading MUST NOT be removed from this file.
 *
 * Licensees are granted free, non-transferable use of the information in this
 * file under Mutual Non-Disclosure Agreement. NO WARRENTY of ANY KIND is provided.
 *
 *******************************************************************************
 */

#ifndef __INIT_H
#define __INIT_H

#include "utils/defs_types.h"

#define INIT_CALL_LEVEL_1   0
#define INIT_CALL_LEVEL_2   1
#define INIT_CALL_LEVEL_3   2
#define INIT_CALL_LEVEL_4   3

typedef void (*initcall_t)(void);

#define __define_initcall(fn, id) \
__attribute__((used)) __attribute__((section(".initcall" #id ".init")))\
initcall_t __initcall_##fn##id   = fn;

void do_initcall(void);
#endif
